package com.eduction.service.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eduction.common.dbutil.page.Page;
import com.eduction.modules.system.entity.SchoolContacts;
import com.eduction.modules.target.dao.SchoolContactsRepository;
import com.eduction.service.SchoolContactService;

@Service
public class SchoolContactServiceImpl implements SchoolContactService {

	@Autowired
	private SchoolContactsRepository schoolContactsRepository;
	
	@Override
	public void saveSchoolContact(SchoolContacts sc) {
		schoolContactsRepository.saveSchoolContact(sc);

	}

	@Override
	public List<SchoolContacts> querySchoolContacts(String type) throws SQLException {
		List<SchoolContacts> list = schoolContactsRepository.querySchoolContacts(type);
		return list;
	}

	@Override
	public void deleteSchoolContact(String pid) {
		schoolContactsRepository.deleteSchoolContact(pid);

	}

	@Override
	public SchoolContacts querySchoolContactsByPid(String pid) throws SQLException {
		SchoolContacts sc = schoolContactsRepository.querySchoolContactsByPid(pid);
		return sc;
	}

	@Override
	public Page<SchoolContacts> querySchoolContactsByPage(Map<String, String> map) throws SQLException {
		Page<SchoolContacts> page = schoolContactsRepository.querySchoolContactsByPage(map);
		return page;
	}

	@Override
	public List<SchoolContacts> querySchoolContactsBySchoolIdAndType(String schoolId, String type) throws SQLException{
		List<SchoolContacts> list = schoolContactsRepository.querySchoolContactsBySchoolIdAndType(schoolId,type);
		return list;
	}

	@Override
	public List<SchoolContacts> queryAll(String contentName, String schoolName) throws SQLException{
		List<SchoolContacts> list = schoolContactsRepository.queryAll(contentName,schoolName);
		return list;
	}
}
